{% extends "layout.html" %}

{% block title %}Dumpcatcher: Profile{% endblock title %}
{% block main %}
  <h1>Welcome! {{ nickname }}</h1>

  <h2>Products!</h2>
  <table border=1>
	<tr>
	  <td>Name</td>
	  <td>Key</td>
	  <td>Secret</td>
	  <td></td>
	</tr>

	{% for product in products %}
	<tr>
	  <td><a href="/product/{{ product.key }}">{{ product.name|escape }}</a></td>
	  <td>{{ product.key }}</td>
	  <td>{{ product.secret|escape }}</td>
	  <td>
		{% if product.tasks %}
	      {{ product.tasks|escape }}
		{% else %}
		  <form id="product_delete" action="/product_delete" method="post">
			<input type="hidden" name="key" value="{{ product.key }}">
			<input type="submit" value="Delete">
		  </form>
		{% endif %}
	  </td>
	</tr>
	{% endfor %}
  </table>

  <h3>Add a Product</h3>
  <form id="product_add" action="/product_add" method="post">
    <label for="name">ID: </label>
    <textarea name="name" name="name"></textarea>
    <input type="submit" value="Submit">
  </form>

{% endblock main %}

{% block sidebar_content %}
{% endblock sidebar_content %}

{% block bottom_block %}
{% endblock bottom_block %}
